<?php
               $auth = Zend_Auth::getInstance();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="shortcut icon"  type="image/png"  href="<?php echo Zend_Registry::get('static_path');?>images/favicon.ico"/>
         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
          <?php echo $this->headTitle();?>
          <link rel="stylesheet" type="text/css" href="<?php echo Zend_Registry::get('static_path');?>css/common.css"/>
           <?php echo $this->headStyle() ?>
          <?php echo $this->headLink() ?>
          <script>
              var path="<?php echo Zend_Registry::get('static_path');?>";
          </script>
           <script src="<?php echo Zend_Registry::get('static_path');?>js/jquery-1.5.1.js"></script>
           <script src="<?php echo Zend_Registry::get('static_path');?>js/common.js"></script>
           <script src="<?php echo Zend_Registry::get('static_path');?>js/jquery.simplemodal.js"></script>
           <?php echo $this->headScript() ?>
</head>
<body>
    <div id="wrapper">
	<div id="container">
	<?php include("header.phtml"); ?>
            <table width="100%">
            <tbody>
                <tr>
                    <td align="left" >                              
                        <div id="logged-in">Logged in as: 
                          <select id="role">
                                                <?php
                                                   $role= $_SESSION['role'];
                                          
                                                    if($auth->getStorage()->read()->RESIDENT =="Y" &&  $role=="R"){
                                                        echo "<option value ='R' selected>Resident</option>";
                                                    }elseif($auth->getStorage()->read()->RESIDENT =="Y"){
                                                        echo "<option value ='R'>Resident</option>";
                                                    }
                                                     if($auth->getStorage()->read()->ADMIN =="Y" &&  $role=="A"){
                                                         echo "<option value ='A' selected>Admin</option>";
                                                    }else if($auth->getStorage()->read()->ADMIN =="Y"){
                                                         echo "<option value ='A'>Admin</option>";
                                                    }
                                                ?>
                          </select>
                        </div>
                    </td>
              
                    <td align="right">
                        <div id="welcome">Welcome, <?php echo $auth->getStorage()->read()->FIRST_NAME?> <?php echo $auth->getStorage()->read()->LAST_NAME?> | <a href="<?php echo $this->url(array( 'controller' => 'process', 'action'     => 'logout'),'default', true) ?>">Logout</a></div>
                    </td>
                </tr>
            </tbody>
        </table>
        <?php echo $this->layout()->content; ?>
             <?php include("footer.phtml"); ?>
     </div>
    </div>
        <script>
                $(document).ready(function(){
                    $("li a#login").addClass("active");
                     $(".menu").css("background","url("+path+"images/selected.gif)");

                     $("#role").change(function(){
                         window.location  =path+"process/changerole?action=change&role="+$("#role").val();
                     });
                  });
        </script>
 </body>
</html>
